package top.healthylife.mapper;

import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import top.healthylife.domain.CheckGroup;

import java.util.List;
import java.util.Map;


public interface CheckGroupMapper {
    //分页查询检查组
    Page<CheckGroup> selectByCondition(@Param("queryString") String queryString);

    CheckGroup findById(Integer id);

    void edit(CheckGroup checkGroup);

    @Delete("delete from t_checkgroup_checkitem where checkgroup_id =#{id} ")
    void deleteAssociation(Integer id);

    @Insert("insert into t_checkgroup_checkitem values (#{checkgroup_id},#{checkitem_id})")
    void setCheckGroupAndCheckItem(Map<String, Integer> map);

    @Delete("delete from t_checkgroup where id =#{id}")
    void delete(Integer id);

    void add(CheckGroup checkGroup);

    @Select("select * from t_checkgroup")
    List<CheckGroup> findAll();
}
